/*
 * 版权：Copyright (c) 2019 红网
 * 
 * 创建日期：Sunday March 10th 2019
 * 创建者：胡燕龙(huyl) - y.dragon.hu@hotmail.com
 * 
 * 修改日期: Wednesday, 13th March 2019 11:08:14 am
 * 修改者: 胡燕龙(huyl) - y.dragon.hu@hotmail.com
 * 
 * 说明
 * 		1、工业互联网标识管理配置
 */
import { ExternalLinksDetailViewControl } from './views/external-links/external-links-detail';
import { ChangeExternalLinkViewControl } from './views/external-links/change-external-links';
import { ExternalLinksViewControl } from './views/external-links/index';
import { CategoryDetailDetailViewControl } from './views/category-template/category-template-detail';
import { ICategoryTemplateSingService } from '../../models/categorySign';
import { IndustryInternetSignApplication } from "./app/index";
import { AjaxJsonRpcFactory, AppReactRouterControl, BlankMainFormControl, CookieUtil } from "pao-aop-client";
import { ISecurityService, createObject, IPermissionService, IRoleService, Permission } from "pao-aop";
// import './mock';
import { StatisticalAnalysisViewControl } from './views/statistical-analysis/index';
import { AddRoleViewControl } from 'src/business/views/add-role';
import { AllSignViewControl } from './views/all-sign/index';
import { IAnalysisStatisticsService } from 'src/models/analysisStatistics';
import { UserManageViewControl } from './views/user-manage/index';
import { IUserService } from 'src/business/models/user';
import { UserEditorViewControl } from './views/user-editor/index';
import { LoginViewControl } from 'src/business/views/login';
import { SingleProductViewControl } from './views/single-product/index';
import { ISingleProductSignService } from 'src/models/singleProductSign';
import { SingleProductDetailViewControl } from './views/single-product/single-product-detail';
import { CompanyTemplateViewControl } from './views/company-template/index';
import { ChangeCategoryTemplateViewControl } from './views/category-template/change-category-template';
import { ChangeSingleProductViewControl } from './views/single-product/chang-singele-product';
import { ICompanyTemplateSignService } from 'src/models/companySign';
import { CompanyTemplateDetailControl } from './views/company-template/company-template-detail';
import { IExternalLinkSignService } from 'src/models/externalLinksSign';
import { IProductTypeService } from 'src/models/productType';
import { ModifyLoginPasswordViewControl } from 'src/business/views/modify-password';
import { ModifyMobileViewControl } from 'src/business/views/modify_mobile';
import { ModifyEmailViewControl } from 'src/business/views/modify_email';
export const remote = {
    url: 'http://localhost:3010/remoteCall',
    login: 'ISecurityService'
};
// export const remote = {
//     url: 'http://192.168.95.42:3010/remoteCall',
//     login: 'ISecurityService'
// };
import { BindPhoneControl } from 'src/business/views/bind-phone';
import { RetrievePasswordControl } from 'src/business/views/retrieve-password';
import { RolePermissionViewControl } from 'src/business/views/role-permission';
import { IIndustryService } from 'src/models/industry';
import { PermissionList } from './app/permission';
import { CategoryTemplateViewControl } from './views/category-template/index';
import { SecuritySettingsViewControl } from 'src/business/views/security-setting';
// import { ModifyEmailViewControl } from 'src/business/views/modify_email';
import { ISignService } from 'src/models/signService';
import { ChangeCompanyTemplateViewControl } from './views/company-template/change-company-template';
import { SignAnalysisViewControl } from './views/sign-analysis/index';
import { IAnalysSignService } from 'src/models/analyssign';
import { ROUTE_PATH, SIGN_ID_PARAM, isPermission, selectedKeys, COMPANY_ID_PARAM, PRODUCT_CLASSIFY_ID_PARAM, PRODUCT_SIGN_ID_PARAM } from './app/util-tool';

import { HeadMainFormControl } from 'src/business/mainForm/headMainForm';
import './style/default.less';
import { SIGN_KEY_PARAM } from 'src/business/util_tool';
import { AbnormityViewControl } from 'src/business/views/abnormity';
import { BackstageManageMainFormControl, COOKIE_KEY_CURRENT_USER, COOKIE_KEY_USER_ROLE } from 'src/business/mainForm/backstageManageMainForm';
import { COOKIE_KEY_COMPANY_ID } from './app/appStorage';
// import { StencilViewControl } from './views/stencil/index';
// import { ChangeStencilViewControl } from './views/stencil/change-stencil';
import { IStencilService } from 'src/models/stencil';
import { ProductClassifyViewControl } from './views/product-classify/index';
import { ChangeProductClassifyViewControl } from './views/product-classify/change-product-classify';
import { IProductClassifyService } from 'src/models/productClassify';
import { IProductSignService } from 'src/models/productSign';
import { ProductSignViewControl } from './views/product-sign/index';
import { ChangeProductSignViewControl } from './views/product-sign/change-product-sign';

const blank = new BlankMainFormControl();
const layoutMain = 'layoutMainForm';
const manage_logo = require("src/projects/industryInternetSign/img/logo.png");

// 主窗体
const layoutMainForm = new BackstageManageMainFormControl(
    "物联网",
    [
        {
            title: "统计", icon: 'user', link: "", key: 1, permission: PermissionList.StatisticalAnalysis_Select, childrenComponent: [
                { key: 'statisticalAnalysis', link: ROUTE_PATH.statisticalAnalysis, title: '统计分析', permission: PermissionList.StatisticalAnalysis_Select, icon: 'font@pao_font_icon_analysis_bright' },

            ]
        },
        {
            title: "标识管理", icon: 'laptop', link: "", key: 2, permission: "3", childrenComponent: [
                { key: 'allSignView', link: ROUTE_PATH.allSignView, title: '全部标识', permission: PermissionList.CompanyTemplate_Select_Admin, icon: 'font@pao_font_icon_Idcode_bright' },
                { key: 'companyTemplateView', link: ROUTE_PATH.companyTemplateView, title: '企业模板标识', permission: PermissionList.CompanyTemplate_Select_Company, icon: 'font@pao_font_icon_company_bright' },
                { key: 'categoryTemplate', link: ROUTE_PATH.categoryTemplate, title: '品类模板标识', permission: PermissionList.CategoryTemplate_Select, icon: 'font@pao_font_icon_class_bright' },
                { key: 'singleProduct', link: ROUTE_PATH.singleProductView, title: '单品标识', permission: PermissionList.SingleProduct_Select, icon: 'font@pao_font_icon_product_bright' },
                { key: 'externalLinks', link: ROUTE_PATH.externalLinks, title: '跳转标识', permission: PermissionList.ExternalLinks_Select, icon: 'font@pao_font_icon_link_bright' },
                // { key: 'stencil', link: ROUTE_PATH.stencil, title: '模版管理', permission: PermissionList.ExternalLinks_Select, icon: 'font@pao_font_icon_link_bright' },
                { key: 'productClassify', link: ROUTE_PATH.productClassify, title: '产品分类', permission: PermissionList.ProductClassify_Select, icon: 'font@pao_font_icon_class_bright' },
                { key: 'productSign', link: ROUTE_PATH.productSign, title: '产品标识', permission: PermissionList.ProductSign_Select, icon: 'font@pao_font_icon_product_bright' },
            ]
        },
        {
            title: "系统管理", icon: 'notification', link: "", key: 3, permission: "8", childrenComponent: [
                { key: 'UserManage', link: ROUTE_PATH.userManage, title: '用户管理', permission: PermissionList.UserManage_Select, icon: 'font@pao_font_icon_user_bright' },
                { key: 'rolePermission', link: ROUTE_PATH.rolePermission, title: '角色管理', permission: PermissionList.RolePermission_Select, icon: 'font@pao_font_icon_role_bright' },
                { key: 'usermanage', link: ROUTE_PATH.securitySettings, title: '安全设置', permission: PermissionList.SecuritySettings_Select, icon: 'font@pao_font_icon_set_bright' },
            ]
        }
    ],
    [
        { key: "scan", icon: "antd@scan", link: "/scan" }
    ],
    function () {
        CookieUtil.remove(COOKIE_KEY_COMPANY_ID);
        CookieUtil.remove(COOKIE_KEY_CURRENT_USER);
        CookieUtil.remove(COOKIE_KEY_USER_ROLE);
    },
    '/login',
    undefined,
    (pathname: string) => selectedKeys(pathname)
);

/** 带头部窗体 */
const HeadMainForm = new HeadMainFormControl(
    // 'src/projects/industryInternetSign/img/logo.png',
    manage_logo,
    '工业互联网标识自助服务平台V1.0'
);
const headMainID = 'HeadMainForm';
const blankID = 'blank';
/** 权限列表 */
const permission_list = [
    { module: "StatisticalAnalysis", module_name: "统计分析", per_name: "查看权限", permission: "StatisticalAnalysis_Select", permission_state: "default" },
    { module: "CompanyTemplate", module_name: "企业标识", per_name: "所有标识查看权限", permission: "AllSign_Select", permission_state: "default" },
    { module: "CompanyTemplate", module_name: "企业标识", per_name: "查看权限", permission: "CompanyTemplate_Select", permission_state: "default" },
    { module: "CompanyTemplate", module_name: "企业标识", per_name: "增加权限", permission: "CompanyTemplate_Add", permission_state: "default" },
    { module: "CompanyTemplate", module_name: "企业标识", per_name: "所有企业查看权限", permission: "CompanyTemplate_Select_Admin", permission_state: "default" },
    { module: "CompanyTemplate", module_name: "企业标识", per_name: "具体企业查看权限", permission: "CompanyTemplate_Select_Company", permission_state: "default" },
    { module: "CategoryTemplate", module_name: "品类标识", per_name: "增删改查权限", permission: "CategoryTemplate_Select", permission_state: "default" },
    { module: "SingleProduct", module_name: "单品标识", per_name: "增删改查权限", permission: "SingleProduct_Select", permission_state: "default" },
    { module: "ExternalLinks", module_name: "跳转标识", per_name: "增删改查权限", permission: "ExternalLinks_Select", permission_state: "default" },
    { module: "SystemManage", module_name: "系统管理", per_name: "用户增删改查权限", permission: "UserManage_Select", permission_state: "default" },
    { module: "SystemManage", module_name: "系统管理", per_name: "角色增删改查权限", permission: "RolePermission_Select", permission_state: "default" },
    { module: "SystemManage", module_name: "系统管理", per_name: "安全设置增删改查权限", permission: "SecuritySettings_Select", permission_state: "default" },
];
let router = new AppReactRouterControl(
    {
        [blankID]: blank,
        [layoutMain]: layoutMainForm,
        [headMainID]: HeadMainForm
    },
    [
        {
            path: '/',
            exact: true,
            redirect: '/login'
        },
        /** 品类相关路由 */
        {
            path: ROUTE_PATH.categoryTemplate,
            mainFormID: layoutMain,
            // targetType:'secure',
            targetObject: createObject(CategoryTemplateViewControl, { categoryService_Fac: new AjaxJsonRpcFactory(ICategoryTemplateSingService, remote.url, "ICategoryTemplateSignService"), productTypeService_Fac: new AjaxJsonRpcFactory(IProductTypeService, remote.url, "IProductTypeService") })
        },
        {
            path: ROUTE_PATH.changeCategoryTemplate,
            mainFormID: layoutMain,
            targetObject: createObject(ChangeCategoryTemplateViewControl, { categoryService_Fac: new AjaxJsonRpcFactory(ICategoryTemplateSingService, remote.url, "ICategoryTemplateSignService"), productTypeService_Fac: new AjaxJsonRpcFactory(IProductTypeService, remote.url, "IProductTypeService"), companyTemplateSignService_fac: new AjaxJsonRpcFactory(ICompanyTemplateSignService, remote.url, "ICompanyTemplateSignService"), stencilService_Fac: new AjaxJsonRpcFactory(IStencilService, remote.url, "IStencilService") }),
            exact: true
        },
        {
            path: `${ROUTE_PATH.changeCategoryTemplate}/${SIGN_ID_PARAM}`,
            mainFormID: layoutMain,
            targetObject: createObject(ChangeCategoryTemplateViewControl, { categoryService_Fac: new AjaxJsonRpcFactory(ICategoryTemplateSingService, remote.url, "ICategoryTemplateSignService"), productTypeService_Fac: new AjaxJsonRpcFactory(IProductTypeService, remote.url, "IProductTypeService"), companyTemplateSignService_fac: new AjaxJsonRpcFactory(ICompanyTemplateSignService, remote.url, "ICompanyTemplateSignService"), stencilService_Fac: new AjaxJsonRpcFactory(IStencilService, remote.url, "IStencilService") })
        },
        {
            path: `${ROUTE_PATH.categoryTemplateDetail}/${SIGN_ID_PARAM}`,
            mainFormID: layoutMain,
            targetObject: createObject(CategoryDetailDetailViewControl, { categoryService_Fac: new AjaxJsonRpcFactory(ICategoryTemplateSingService, remote.url, "ICategoryTemplateSignService"), productTypeService_Fac: new AjaxJsonRpcFactory(IProductTypeService, remote.url, "IProductTypeService") })
        },

        /** 外链相关路由 */
        {
            path: ROUTE_PATH.externalLinks,
            mainFormID: layoutMain,
            // targetType:'secure',
            targetObject: createObject(ExternalLinksViewControl, { externalLinkService_Fac: new AjaxJsonRpcFactory(IExternalLinkSignService, remote.url, "IExternalLinkSignService") })
        },
        {
            path: `${ROUTE_PATH.changeExternalLinks}/${SIGN_ID_PARAM}`,
            mainFormID: layoutMain,
            targetObject: createObject(ChangeExternalLinkViewControl, { externalLinkService_Fac: new AjaxJsonRpcFactory(IExternalLinkSignService, remote.url, "IExternalLinkSignService"), companyTemplateSignService_fac: new AjaxJsonRpcFactory(ICompanyTemplateSignService, remote.url, "ICompanyTemplateSignService") })
        },
        {
            path: `${ROUTE_PATH.externalLinksDetail}/${SIGN_ID_PARAM}`,
            mainFormID: layoutMain,
            targetObject: createObject(ExternalLinksDetailViewControl, { externalLinkService_Fac: new AjaxJsonRpcFactory(IExternalLinkSignService, remote.url, "IExternalLinkSignService") })
        },
        {
            path: ROUTE_PATH.changeExternalLinks,
            mainFormID: layoutMain,
            targetObject: createObject(ChangeExternalLinkViewControl, { externalLinkService_Fac: new AjaxJsonRpcFactory(IExternalLinkSignService, remote.url, "IExternalLinkSignService"), companyTemplateSignService_fac: new AjaxJsonRpcFactory(ICompanyTemplateSignService, remote.url, "ICompanyTemplateSignService") }),
            exact: true
        },

        /** */
        {
            path: ROUTE_PATH.statisticalAnalysis,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(
                StatisticalAnalysisViewControl,
                {
                    analysisStatisticsService_Fac: new AjaxJsonRpcFactory(
                        IAnalysisStatisticsService,
                        remote.url,
                        "IAnalysisStatisticsService"),
                    current_company_sign_path: ROUTE_PATH.companyTemplateDetail
                })
        },
        {
            path: ROUTE_PATH.allSignView,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(AllSignViewControl, { ISignService_Fac: new AjaxJsonRpcFactory(ISignService, remote.url, "ISignService") })
        },
        {
            path: ROUTE_PATH.rolePermission,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(
                RolePermissionViewControl,
                {
                    permissionService_Fac: new AjaxJsonRpcFactory(IPermissionService, remote.url, "IPermissionService"),
                    roleService_Fac: new AjaxJsonRpcFactory(IRoleService, remote.url, "IPermissionService"),
                    permission: PermissionList.RolePermission_Select,
                    isPermission: (permissionis: Permission) => isPermission(permissionis)
                })
        },
        {
            path: `${ROUTE_PATH.addRole}/${SIGN_KEY_PARAM}`,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(
                AddRoleViewControl, {
                    permissionService_Fac: new AjaxJsonRpcFactory(IPermissionService, remote.url, "IPermissionService"),
                    roleService_Fac: new AjaxJsonRpcFactory(IRoleService, remote.url, "IPermissionService"),
                    permission: PermissionList.RolePermission_Select,
                    isPermission: (permissionis: Permission) => isPermission(permissionis),
                    permission_list: permission_list
                })
        },
        {
            path: ROUTE_PATH.userManage,
            exact: true,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(
                UserManageViewControl,
                {
                    userService_Fac: new AjaxJsonRpcFactory(IUserService, remote.url, "IUserService"),
                    permissionService_Fac: new AjaxJsonRpcFactory(IPermissionService, remote.url, "IPermissionService"),
                    roleService_Fac: new AjaxJsonRpcFactory(IRoleService, remote.url, "IPermissionService"),
                    permission: PermissionList.UserManage_Select,
                    isPermission: (permissionis: Permission) => isPermission(permissionis)
                })
        },
        {
            path: `${ROUTE_PATH.userEditor}/${SIGN_KEY_PARAM}`,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(
                UserEditorViewControl,
                {
                    userService_Fac: new AjaxJsonRpcFactory(IUserService, remote.url, "IUserService"),
                    permissionService_Fac: new AjaxJsonRpcFactory(IPermissionService, remote.url, "IPermissionService"),
                    roleService_Fac: new AjaxJsonRpcFactory(IRoleService, remote.url, "IPermissionService"),
                    permission: PermissionList.UserManage_Select,
                    isPermission: (permissionis: Permission) => isPermission(permissionis)
                })
        },
        {
            path: ROUTE_PATH.addRole,
            mainFormID: layoutMain,
            targetType: 'secure',
            exact: true,
            targetObject: createObject(
                AddRoleViewControl,
                {
                    permissionService_Fac: new AjaxJsonRpcFactory(IPermissionService, remote.url, "IPermissionService"),
                    roleService_Fac: new AjaxJsonRpcFactory(IRoleService, remote.url, "IPermissionService"),
                    permission: PermissionList.RolePermission_Select,
                    isPermission: (permissionis: Permission) => isPermission(permissionis),
                    permission_list: permission_list
                })
        },
        {
            path: ROUTE_PATH.userEditor,
            mainFormID: layoutMain,
            targetType: 'secure',
            exact: true,
            targetObject: createObject(UserEditorViewControl, {
                userService_Fac: new AjaxJsonRpcFactory(IUserService, remote.url, "IUserService"),
                permissionService_Fac: new AjaxJsonRpcFactory(IPermissionService, remote.url, "IPermissionService"),
                roleService_Fac: new AjaxJsonRpcFactory(IRoleService, remote.url, "IPermissionService"),
                permission: PermissionList.UserManage_Select,
                isPermission: (permissionis: Permission) => isPermission(permissionis)
            })
        },
        {
            path: ROUTE_PATH.login,
            mainFormID: headMainID,
            targetObject: createObject(LoginViewControl, {
                home_path: ROUTE_PATH.statisticalAnalysis,
                bind_phone_path: ROUTE_PATH.bindPhone,
                modify_password_path: ROUTE_PATH.modifyLoginPassword,
                retrieve_password: ROUTE_PATH.retrievePassword
            })
        }, {
            path: ROUTE_PATH.bindPhone,
            mainFormID: headMainID,
            targetType: "secure",
            targetObject: createObject(BindPhoneControl, { link_url: '/statistical-analysis' })
        }, {
            path: ROUTE_PATH.retrievePassword,
            mainFormID: headMainID,
            targetObject: createObject(RetrievePasswordControl)
        }, {
            path: ROUTE_PATH.securitySettings,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(SecuritySettingsViewControl, {
                userService_Fac: new AjaxJsonRpcFactory(IUserService, remote.url, "IUserService"),
                modify_password: ROUTE_PATH.modifyLoginPassword,
                modify_mobile: ROUTE_PATH.modifyMobile,
                modify_email: ROUTE_PATH.modifyEmail,
            })
        }, {
            path: ROUTE_PATH.modifyLoginPassword,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(ModifyLoginPasswordViewControl, { userService_Fac: new AjaxJsonRpcFactory(IUserService, remote.url, "IUserService") })
        }, {
            path: ROUTE_PATH.modifyMobile,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(ModifyMobileViewControl, { userService_Fac: new AjaxJsonRpcFactory(IUserService, remote.url, "IUserService") })
        }, {
            path: ROUTE_PATH.modifyEmail,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(ModifyEmailViewControl, { userService_Fac: new AjaxJsonRpcFactory(IUserService, remote.url, "IUserService") })
        },
        {
            path: ROUTE_PATH.singleProductView,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(SingleProductViewControl, { singleProductSignService_Fac: new AjaxJsonRpcFactory(ISingleProductSignService, remote.url, "ISingleProductSignService"), productTypeService_Fac: new AjaxJsonRpcFactory(IProductTypeService, remote.url, "IProductTypeService") })
        },
        {
            path: `${ROUTE_PATH.singleProductDetailView}/${SIGN_ID_PARAM}`,
            mainFormID: layoutMain,
            targetObject: createObject(SingleProductDetailViewControl, { singleProductSignService_Fac: new AjaxJsonRpcFactory(ISingleProductSignService, remote.url, "ISingleProductSignService"), productTypeService_Fac: new AjaxJsonRpcFactory(IProductTypeService, remote.url, "IProductTypeService") })
        },
        {
            path: ROUTE_PATH.companyTemplateView,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(
                CompanyTemplateViewControl,
                {
                    companyTemplateSignService_Fac: new AjaxJsonRpcFactory(
                        ICompanyTemplateSignService,
                        remote.url,
                        "ICompanyTemplateSignService"),
                    industryService_Fac: new AjaxJsonRpcFactory(
                        IIndustryService,
                        remote.url,
                        "IIndustryService"),
                    current_company_sign_path: ROUTE_PATH.companyTemplateDetail
                })
        },
        {

            path: `${ROUTE_PATH.changeCompanyTemplateView}/${SIGN_ID_PARAM}`,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(ChangeCompanyTemplateViewControl, { companyTemplateSignService_fac: new AjaxJsonRpcFactory(ICompanyTemplateSignService, remote.url, "ICompanyTemplateSignService"), IIndustryService_Fac: new AjaxJsonRpcFactory(IIndustryService, remote.url, "IIndustryService"), stencilService_Fac: new AjaxJsonRpcFactory(IStencilService, remote.url, "IStencilService") })
        },
        {
            path: ROUTE_PATH.changeCompanyTemplateView,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(ChangeCompanyTemplateViewControl, { companyTemplateSignService_fac: new AjaxJsonRpcFactory(ICompanyTemplateSignService, remote.url, "ICompanyTemplateSignService"), IIndustryService_Fac: new AjaxJsonRpcFactory(IIndustryService, remote.url, "IIndustryService"), stencilService_Fac: new AjaxJsonRpcFactory(IStencilService, remote.url, "IStencilService") }),
            exact: true
        },
        {
            path: `${ROUTE_PATH.changeSingleProductView}/${SIGN_ID_PARAM}`,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(ChangeSingleProductViewControl, { singleProductSignService_Fac: new AjaxJsonRpcFactory(ISingleProductSignService, remote.url, "ISingleProductSignService"), productTypeService_Fac: new AjaxJsonRpcFactory(IProductTypeService, remote.url, "IProductTypeService"), companyTemplateSignService_fac: new AjaxJsonRpcFactory(ICompanyTemplateSignService, remote.url, "ICompanyTemplateSignService"), stencilService_Fac: new AjaxJsonRpcFactory(IStencilService, remote.url, "IStencilService") })
        },
        {
            exact: true,
            path: ROUTE_PATH.changeSingleProductView,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(ChangeSingleProductViewControl, { singleProductSignService_Fac: new AjaxJsonRpcFactory(ISingleProductSignService, remote.url, "ISingleProductSignService"), productTypeService_Fac: new AjaxJsonRpcFactory(IProductTypeService, remote.url, "IProductTypeService"), companyTemplateSignService_fac: new AjaxJsonRpcFactory(ICompanyTemplateSignService, remote.url, "ICompanyTemplateSignService"), stencilService_Fac: new AjaxJsonRpcFactory(IStencilService, remote.url, "IStencilService") })
        },
        {
            path: `${ROUTE_PATH.companyTemplateDetail}/${COMPANY_ID_PARAM}`,
            mainFormID: layoutMain,
            targetType: 'secure',
            targetObject: createObject(CompanyTemplateDetailControl, { companyTemplateSignService_fac: new AjaxJsonRpcFactory(ICompanyTemplateSignService, remote.url, "ICompanyTemplateSignService"), productTypeService_Fac: new AjaxJsonRpcFactory(IProductTypeService, remote.url, "IProductTypeService") })
        },
        {
            path: ROUTE_PATH.signPreview,
            mainFormID: blankID,
            targetObject: createObject(SignAnalysisViewControl, { IAnalysSignService_Fac: new AjaxJsonRpcFactory(IAnalysSignService, remote.url, "IAnalysSignService") })
        }, {
            path: ROUTE_PATH.Abnormity,
            mainFormID: layoutMain,
            targetObject: createObject(AbnormityViewControl)
        },
        // {
        //     path: ROUTE_PATH.stencil,
        //     mainFormID: layoutMain,
        //     targetObject: createObject(StencilViewControl, { stencilService_Fac: new AjaxJsonRpcFactory(IStencilService, remote.url, "IStencilService") })
        // }, {
        //     path: `${ROUTE_PATH.changeStencil}/${STENCIL_ID_PARAM}`,
        //     mainFormID: layoutMain,
        //     targetObject: createObject(ChangeStencilViewControl, { stencilService_Fac: new AjaxJsonRpcFactory(IStencilService, remote.url, "IStencilService") })
        // }, {
        //     path: ROUTE_PATH.changeStencil,
        //     mainFormID: layoutMain,
        //     targetObject: createObject(ChangeStencilViewControl, { stencilService_Fac: new AjaxJsonRpcFactory(IStencilService, remote.url, "IStencilService") })
        // }
        {
            path: ROUTE_PATH.productClassify,
            mainFormID: layoutMain,
            targetObject: createObject(ProductClassifyViewControl, { productClassifyService_Fac: new AjaxJsonRpcFactory(IProductClassifyService, remote.url, "IProductClassifyService") })
        }, {
            path: `${ROUTE_PATH.changeProductClassify}/${PRODUCT_CLASSIFY_ID_PARAM}`,
            mainFormID: layoutMain,
            targetObject: createObject(ChangeProductClassifyViewControl, { productClassifyService_Fac: new AjaxJsonRpcFactory(IProductClassifyService, remote.url, "IProductClassifyService") })
        }, {
            path: ROUTE_PATH.changeProductClassify,
            mainFormID: layoutMain,
            targetObject: createObject(ChangeProductClassifyViewControl, { productClassifyService_Fac: new AjaxJsonRpcFactory(IProductClassifyService, remote.url, "IProductClassifyService") })
        },
        {
            path: ROUTE_PATH.productSign,
            mainFormID: layoutMain,
            targetObject: createObject(ProductSignViewControl, { productSignService_Fac: new AjaxJsonRpcFactory(IProductSignService, remote.url, "IProductSignService") })
        }, {
            path: `${ROUTE_PATH.changeProductSign}/${PRODUCT_SIGN_ID_PARAM}`,
            mainFormID: layoutMain,
            targetObject: createObject(ChangeProductSignViewControl, { productSignService_Fac: new AjaxJsonRpcFactory(IProductSignService, remote.url, "IProductSignService"), productTypeService_Fac: new AjaxJsonRpcFactory(IProductTypeService, remote.url, "IProductTypeService"), productClassifyService_Fac: new AjaxJsonRpcFactory(IProductClassifyService, remote.url, "IProductClassifyService"), companyTemplateSignService_fac: new AjaxJsonRpcFactory(ICompanyTemplateSignService, remote.url, "ICompanyTemplateSignService") })
        }, {
            path: ROUTE_PATH.changeProductSign,
            mainFormID: layoutMain,
            targetObject: createObject(ChangeProductSignViewControl, { productSignService_Fac: new AjaxJsonRpcFactory(IProductSignService, remote.url, "IProductSignService"), productTypeService_Fac: new AjaxJsonRpcFactory(IProductTypeService, remote.url, "IProductTypeService"), productClassifyService_Fac: new AjaxJsonRpcFactory(IProductClassifyService, remote.url, "IProductClassifyService"), companyTemplateSignService_fac: new AjaxJsonRpcFactory(ICompanyTemplateSignService, remote.url, "ICompanyTemplateSignService") })
        }

    ],
    '/login'
);

export let defaultObject = new IndustryInternetSignApplication(
    router,
    new AjaxJsonRpcFactory(ISecurityService, remote.url, remote.login),
    new AjaxJsonRpcFactory(IUserService, remote.url, "IUserService"),
    new AjaxJsonRpcFactory(ICompanyTemplateSignService, remote.url, "ICompanyTemplateSignService"));

export default defaultObject;